<%@ page language="java"%>
<%@ page import="org.fiel.FielConstants" %>

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

    <script language="javascript">
        showLabel("ver");

        function validar(){
        var valido = false;
        
        for(i=0;i<document.forms[0].length;i++){
        if(document.forms[0][i].checked){
        valido = true;
        break;
        }
        }
            
        return valido;
        }
    </script>	

    <form action="/adm/Recursos.do?method=view" onsubmit="return false;" method="post">
        <input type="hidden" name="editable" value="false">
        
        <p align="center">
            <input type="button" value="Ver Detalles" onclick="if(validar()){document.forms[0].action='/adm/Recursos.do?method=view';document.forms[0].submit()}" style="height:18pt;width:20%;background-color:rgb(204, 204, 204);color:rgb(0, 0, 0);font-family: arial; font-size: 9pt;font-weight:normal">
            <input type="button" value="Editar" onclick="if(validar()){document.forms[0].action='/adm/Recursos.do?method=view';document.forms[0].editable.value='true';document.forms[0].submit()}" style="height:18pt;width:20%;background-color:rgb(204, 204, 204);color:rgb(0, 0, 0);font-family: arial; font-size: 9pt;font-weight:normal">
            <input type="button" value="Eliminar" onclick="if(validar()){document.forms[0].action='/adm/Recursos.do?method=delete';document.forms[0].submit()}" style="height:18pt;width:20%;background-color:rgb(204, 204, 204);color:rgb(0, 0, 0);font-family: arial; font-size: 9pt;font-weight:normal">
            <input type="reset" value="Borrar" style="height:18pt;width:20%;background-color:rgb(204, 204, 204);color:rgb(0, 0, 0);font-family: arial; font-size: 9pt;font-weight:normal">
        </p>
        <br>

        <table border="0" cellpadding="5" cellspacing="0" width="80%" align="center" style="font-family:arial;font-size:8pt">
            <tr>
                <th width="5%" style="background-color:#3399ca;color:#ffffff">
                    &nbsp;
                </th>
                <th width="55%" style="background-color:#3399ca;color:#ffffff">
                    Recurso
                </th>
            </tr>
        </table>

        <center>
            <div style="width: 81%;height: 182px;overflow: auto;" align="center">
                <table border="1" cellpadding="2" cellspacing="0" width="99%" align="center" style="font-family:arial;font-size:8pt;border-top:0px none #cccccc;border-bottom:1px solid #cccccc">
                    <logic:iterate name='<%=FielConstants.RECURSOS%>' scope="request" id="recurso">
                        <tr>
                            <td width="5%">
                                <input type="radio" name="id" value="<bean:write name="recurso" property="id"/>">
                            </td>
                            <td width="55%">
                                <bean:write name="recurso" property="apellido"/>,&nbsp;<bean:write name="recurso" property="nombre"/>
                            </td>
                        </tr>
                    </logic:iterate>
                </table>
            </div>
        </center>
    </form>